import Vue from 'vue'
import Vuex from 'vuex'

import sideMeun from '@/config/sidebar'
import modules from './modules/index.js'



Vue.use(Vuex)

export default new Vuex.Store({
    modules:modules,
    state: {
        currentMeun: sideMeun[0],// 当前左侧导航
    },
    getters: {
        currentSideMeun: (state) => (index) => {
            return state.currentMeun[index]
        }
    },
    mutations: {
        changeSideMenu(state, index,) {

            state.currentMeun = sideMeun[index];
   
        }
    }
})